package com.hopu.aop.springaop;

import com.hopu.aop.springaop.service.IGoodsService;
import com.hopu.aop.springaop.service.IUserService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringAOPTest {

    public static void main(String[] args) {
        //创建XML容器对象
        ClassPathXmlApplicationContext cxt = new ClassPathXmlApplicationContext("spring-aop.xml");
        //获得对象
        IUserService userService = cxt.getBean(IUserService.class);
        //调用方法
        //userService.add();
        userService.delete();
        userService.query();
        userService.update();
        //获得对象
        IGoodsService goodsService = cxt.getBean(IGoodsService.class);
        //调用方法
        goodsService.add();
        goodsService.delete();
        goodsService.query();
        goodsService.update();
    }
}
